# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>

pkgname=libuv
pkgver=1.23.2
pkgrel=1
pkgdesc="Multi-platform support library with a focus on asynchronous I/O"
arch=('x86_64')
url="https://github.com/libuv/libuv"
license=('custom')
depends=('glibc' 'libnsl')
makedepends=('python-sphinx')
source=("https://github.com/libuv/libuv/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('f91accf4ba9987fad23cc546a9821c3d643f8505cae22e0cbe28c4d5d5cb6b370b3483c6d95195cff3bcddd1e94f1bdab740075c3eaf22f8f673f7a57c1fdfc5')

build() {
	cd $pkgname-$pkgver
	./autogen.sh
	./configure --prefix=/usr
	make
	make man -C docs
}

check() {
	cd $pkgname-$pkgver
	make check
}

package() {
	cd $pkgname-$pkgver

	make DESTDIR="$pkgdir" install

	install -Dm644 LICENSE \
		"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
	install -Dm644 AUTHORS \
		"$pkgdir"/usr/share/doc/$pkgname/AUTHORS
	install -Dm644 README.md \
		"$pkgdir"/usr/share/doc/$pkgname/README.md
	install -Dm644 ChangeLog \
		"$pkgdir"/usr/share/doc/$pkgname/ChangeLog
	install -Dm644 docs/build/man/libuv.1 \
		"$pkgdir"/usr/share/man/man1/libuv.1
}
